package cn.edu.sjtu.stap.cg;

public class CgCallSite extends CgNode implements ICgShadow {
    private static final long serialVersionUID = 1L;

    private CgMethod caller;

    private CgMethod callee;

    public CgCallSite(CgMethod caller, CgMethod callee) {
        this.caller = caller;
        this.callee = callee;
    }

    public CgMethod getCaller() {
        return caller;
    }

    public CgMethod getCallee() {
        return callee;
    }

    // TODO: Return a meaningful string.
    public String toString() {
        StringBuffer sb = new StringBuffer();

        sb.append("<Call Site Id: ");
        sb.append(this.getId());
        sb.append(", Caller: ");
        sb.append(caller.getMethodName());
        sb.append(", Callee: ");
        sb.append(callee.getMethodName());
        sb.append(">");

        return sb.toString();
    }

}
